<!-- 
  @Created by pangzg pangzg2@yusys.com.cn on 2020-4-14 10:37:16.
  @updated by
  @description 翻牌日期监控
-->
<div>
  <yu-panel title="翻牌日期监控" v-loading="exportLoading">
    <yu-xform related-table-name="refTable" form-type="search" v-model="searchFormdata">
      <yu-xform-group :column="4">
        <yu-xform-item label="作业流代码" placeholder="作业流代码" ctype="input" name="groupCode"></yu-xform-item>
        <yu-xform-item label="翻牌日期" placeholder="翻牌日期" ctype="datepicker" name="txdate" value-format="yyyyMMdd" format="yyyyMMdd"></yu-xform-item>
        <yu-xform-item label="偏移量" placeholder="偏移量" ctype="input" name="txdateOffset"></yu-xform-item>
      </yu-xform-group>
    </yu-xform>
    <yu-toolBar>
      <yu-button @click="addFn" v-if="addFnShow">新增</yu-button>
      <yu-button @click="modifyFn" v-if="updateFnShow">修改</yu-button>
      <yu-button @click="deleteFn" v-if="deleteFnShow">删除</yu-button>
	  <yu-button @click="importFlowFn" v-if="importFnButton">excel导入</yu-button>
	  <yu-button @click="exportFlowFn" v-if="exportFnButton">excel导出</yu-button>
    </yu-toolBar>
	<div ref="tableBox" style="overflow: auto;">
		<yu-xtable row-key="groupCode" :height="tbHeight" ref="refTable" pageable reserve-selection row-key="groupCode" row-number :data-url="dataUrl" selection-type="checkbox">
		  <yu-xtable-column label="作业流代码" prop="groupCode"></yu-xtable-column>
		  <yu-xtable-column label="翻牌日期" prop="txdate"></yu-xtable-column>
		  <yu-xtable-column label="偏移量" prop="txdateOffset"></yu-xtable-column>
		</yu-xtable>
	</div>
    <!-- 说明dialog可配置宽高属性，若不配置则宽度默认为屏幕50%，高度自适应
     width="650px" height="380px" -->
    <yu-xdialog :title="viewTitle" :visible.sync="dialogVisible" width="750px">
      <yu-xform ref="refForm" label-width="120px" v-model="formdata" :disabled="formDisabled">
        <yu-xform-group>
          <yu-xform-item label="作业流代码" ctype="input" name="groupCode" rules="required" :disabled="!addFlag"></yu-xform-item>
          <yu-xform-item label="翻牌日期" placeholder="请选择翻牌日期" rules="required" ctype="datepicker" name="txdate" value-format="yyyyMMdd" format="yyyyMMdd"></yu-xform-item>
<!-- 		  <yu-xform-item label="翻牌日期" ctype="input" name="txdate" rules="required"></yu-xform-item> -->
          <yu-xform-item label="偏移量" ctype="input" name="txdateOffset" :rules="offsetRules"></yu-xform-item>
        </yu-xform-group>
        <div class="yu-grpButton">
          <yu-button @click="cancelFn">取消</yu-button>
          <yu-button type="primary" @click="saveFn">保存</yu-button>
        </div>
      </yu-xform>
    </yu-xdialog>
  </yu-panel>
  
  <yu-dialog title="excel导入" :visible.sync="upLoadDialogVisible" width="400px" v-loading="excelloading">
  				<yu-upload class="upload-demo" ref="my-upload" :action="upLoadUrl" accept=".xls,.xlsx" :before-upload="checkUpload"
  					 :multiple="multipleFalg"	:on-success="successUpload" :file-list="appUploadDatas">
  					<yu-button size="small" type="primary">点击上传</yu-button>
					<a slot="tip" class="downloadcss" @click="exportDemo">模板下载</a>
  					<div slot="tip" class="el-upload__tip">只能上传excel文件，且不超过100M</div>
  				</yu-upload>
  				<div class="uplaod-errinfo" v-if="errshow">
  					<yu-tag type="danger">上传失败，错误信息如下：</yu-tag>
  					<div class="uplaod-errlist">
  							<yu-table :data="errdata" highlight-current-row style="width:100%" show-header>
  								<yu-table-column type="index"  width="50">
  									
  								</yu-table-column>
  								<yu-table-column prop="errMsg" label="错误信息">
  									
  								</yu-table-column>
  							</yu-table>	
  					</div>
  				</div>
  </yu-dialog>
  
</div>


<style type="text/css">
	.downloadcss{
		cursor: pointer;
		margin-left:10px;
	}
</style>